﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XLua;

public static class CustomGenConfig
{
    //热更新
    [Hotfix]
    public static List<Type> by_field = new List<Type>()
    {
        typeof(ZL_Framework.Game.BoardManager),
        typeof(ZL_Framework.Game.LineCoreController),
        typeof(ZL_Framework.Game.ShapeItem),
        typeof(ZL_Framework.Game.ShapeItemNormal),
        typeof(ZL_Framework.Game.ShapeItemDye),
        typeof(ZL_Framework.LuaManager)
    };

    //lua中要使用到C#库的配置，比如C#标准库，或者Unity API，第三方库等。
    [LuaCallCSharp]
    public static List<Type> LuaCallCSharp = new List<Type>() {
                typeof(System.Object),
                typeof(UnityEngine.Object),
                typeof(Vector2),
                typeof(Vector3),
                typeof(Vector4),
                typeof(Quaternion),
                typeof(Color),
                typeof(Ray),
                typeof(Bounds),
                typeof(Ray2D),
                typeof(Time),
                typeof(GameObject),
                typeof(Component),
                typeof(Behaviour),
                typeof(Transform),
                typeof(Resources),
                typeof(TextAsset),
                typeof(Keyframe),
                typeof(AnimationCurve),
                typeof(AnimationClip),
                typeof(MonoBehaviour),
                typeof(ZL_Framework.LuaBehaviour),
                typeof(ParticleSystem),
                typeof(SkinnedMeshRenderer),
                typeof(Renderer),
                typeof(WaitForSeconds),
                //typeof(Light),
                typeof(Mathf),
                typeof(System.Collections.Generic.List<int>),
                typeof(Action<string>),
                typeof(UnityEngine.Debug),
                typeof(LuaCoroutiner),
                typeof(ZL_Framework.AssetBundlesManager),
                typeof(ZL_Framework.UIManager),
                typeof(ZL_Framework.AudioManager),
                typeof(ZL_Framework.LuaUIPanel),
                typeof(ZL_Framework.AppConfig),
                typeof(ZL_Framework.UIType),
                typeof(ZL_Framework.MsgDispatcherController),
                typeof(ZL_Framework.SequenceFrameAnim),
                typeof(ZL_Framework.LogTool),
                typeof(ZL_Framework.Timer),
                typeof(ZL_Framework.GameObjectPool),
                typeof(ZL_Framework.HttpRequestManager),
                typeof(ZL_Framework.Extensions),
                typeof(ZL_Framework.Game.BoardManager),
                typeof(ZL_Framework.Game.LineCoreController),
                typeof(ZL_Framework.Game.ShapeItem),
                typeof(ZL_Framework.Game.ShapeItemNormal),
                typeof(ZL_Framework.Game.ShapeItemDye),
                typeof(DG.Tweening.AutoPlay),
                typeof(DG.Tweening.AxisConstraint),
                typeof(DG.Tweening.Ease),
                typeof(DG.Tweening.LogBehaviour),
                typeof(DG.Tweening.LoopType),
                typeof(DG.Tweening.PathMode),
                typeof(DG.Tweening.PathType),
                typeof(DG.Tweening.RotateMode),
                typeof(DG.Tweening.ScrambleMode),
                typeof(DG.Tweening.TweenType),
                typeof(DG.Tweening.UpdateType),

                typeof(DG.Tweening.DOTween),
                typeof(DG.Tweening.DOVirtual),
                typeof(DG.Tweening.EaseFactory),
                typeof(DG.Tweening.Tweener),
                typeof(DG.Tweening.Tween),
                typeof(DG.Tweening.Sequence),
                typeof(DG.Tweening.TweenParams),
                typeof(DG.Tweening.Core.ABSSequentiable),

                typeof(DG.Tweening.Core.TweenerCore<Vector3, Vector3, DG.Tweening.Plugins.Options.VectorOptions>),

                typeof(DG.Tweening.TweenCallback),
                typeof(DG.Tweening.TweenExtensions),
                typeof(DG.Tweening.TweenSettingsExtensions),
                typeof(DG.Tweening.ShortcutExtensions),
                typeof(DG.Tweening.ShortcutExtensions43),
                typeof(DG.Tweening.ShortcutExtensions46),
                typeof(DG.Tweening.ShortcutExtensions50)
            };

    //C#静态调用Lua的配置（包括事件的原型），仅可以配delegate，interface
    [CSharpCallLua]
    public static List<Type> CSharpCallLua = new List<Type>() {
                typeof(Action),
                typeof(Func<double, double, double>),
                typeof(Action<string>),
                typeof(Action<float>),
                typeof(Action<double>),
                typeof(UnityEngine.Events.UnityAction),
                typeof(System.Collections.IEnumerator),
                typeof(Action<ZLMsg.IMsgParam>),
                typeof(Action<string, ZL_Framework.LuaUIPanel>),
                typeof(Action<ZL_Framework.IUIPanel>),
                typeof(Action<ZL_Framework.IUIParam>)
            };

    //黑名单
    [BlackList]
    public static List<List<string>> BlackList = new List<List<string>>()  {
                new List<string>(){"System.Xml.XmlNodeList", "ItemOf"},
                new List<string>(){"UnityEngine.WWW", "movie"},
    #if UNITY_WEBGL
                new List<string>(){"UnityEngine.WWW", "threadPriority"},
    #endif
                new List<string>(){"UnityEngine.Texture2D", "alphaIsTransparency"},
                new List<string>(){"UnityEngine.Security", "GetChainOfTrustValue"},
                new List<string>(){"UnityEngine.CanvasRenderer", "onRequestRebuild"},
                new List<string>(){"UnityEngine.Light", "areaSize"},
                new List<string>(){"UnityEngine.Light", "lightmapBakeType"},
                new List<string>(){"UnityEngine.WWW", "MovieTexture"},
                new List<string>(){"UnityEngine.WWW", "GetMovieTexture"},
                new List<string>(){"UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup"},
    #if !UNITY_WEBPLAYER
                new List<string>(){"UnityEngine.Application", "ExternalEval"},
    #endif
                new List<string>(){"UnityEngine.GameObject", "networkView"}, //4.6.2 not support
                new List<string>(){"UnityEngine.Component", "networkView"},  //4.6.2 not support
                new List<string>(){"System.IO.FileInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
                new List<string>(){"System.IO.FileInfo", "SetAccessControl", "System.Security.AccessControl.FileSecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
                new List<string>(){"System.IO.DirectoryInfo", "SetAccessControl", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "CreateSubdirectory", "System.String", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"System.IO.DirectoryInfo", "Create", "System.Security.AccessControl.DirectorySecurity"},
                new List<string>(){"UnityEngine.MonoBehaviour", "runInEditMode"},
            };
}